package com.example.demo.commen;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2023-02-16
 * Time:10:05
 */
//统一异常处理
@ControllerAdvice
public class ExceptionAdvice {
    @ExceptionHandler(Exception.class)
    public Object ExceptionAdvice(Exception e){
        return AjaxResult.fail(-1,e.getMessage());
    }

}
